//let {SyncHook} = require('tapable');
class SyncHook{
    constructor(){
        this.taps = [];
    }
    tap(name,fn){//注册  on 
        this.taps.push(fn);
    }
    call(){//触发 emit
        this.taps.forEach(tap=>tap());
    }
}
let hook = new SyncHook();
hook.tap('a',()=>{//注册回调
    console.log('a');
});
hook.tap('b',()=>{
    console.log('b');
});
hook.tap('c',()=>{
    console.log('c');
});
hook.call();//触发事件，执行回调
